Package: py-ecowater
py_ecowaterA python library for getting device data from Ecowater API for devices such as the Rheem RHW42 water softener, which
provides WI-FI connectivity via the iQua app.Installationpipinstallpy_ecowaterUsageThe primary class isEcowaterClient.  It takes two parameters,usernameandpassword.These are the same credentials you use to log in to the app. The primary methods areget_devices,get_user_profile,get_systems, andget_system_state.Theget_system_statemethod takes a single parameter,serial_number, which is the serial number of the system you
want to get the state of and can be found from the system information returned byget_systems.The methods return python objects that can be accessed as attributes.importosfrompy_ecowaterimportEcowaterClientusername=os.environ.get('ECOWATER_USERNAME')password=os.environ.get('ECOWATER_PASSWORD')client=EcowaterClient(username,password)devices=client.get_devices()'''{"devices": [{"id": 12345,"email": "myemail@test.com","type": "AC","status": "READY","role": "user","user_uuid": null,"dealer_id": null,"members": null,"alerts_ack": null,"mydata": null,"date": 1650692107704,"created_by": "user"}]}'''profile=client.get_user_profile()'''{"id": "<unique id>","name": "Bob,Ross","email": "myemail@test.com","company": {"phone_country_code": "","phone": "1234567890","primary_phone_code": "","primary_phone": "1234567890","members_count": 2,"support_phone": "","support_phone_code": ""},"phone": "1234567890","time_zone": null,"address_line_1": "123 My Addr Rd","address_line_2": "","city": "My City","state": null,"zip_code": "98765","country": "US","contact_language": "en","roles": ["user"],"change_password": false,"manufacturer_id": "","first_name": "Bob","last_name": "Ross","meta": {"phone_country_code": "","phone": "1234567890","primary_phone_code": "+1","primary_phone": "1234567890","members_count": 2,"support_phone": "","support_phone_code": ""}}'''systems=client.get_systems()'''{"systems": [{"id": "<system id>","serial_number": "SL0<serial number>","nickname": "Water Softener","description": {"unit_owner": "customer","rental_access": 1},"ac_role_name": "User","role": "user","model_id": "<model id>","model_name": "108201","model_description": "Rheem RHW42","system_type": "demand softener","dealer_access": false,"alarms_alerts": false,"is_rental": false,"is_restricted": false,"alerts_active": null,"is_super_hero": false,"is_filter_system": false,"product_image": "Rheem","water_shut_off_valve_control": true}]}'''system_state=client.get_system_state(systems.systems[0].serial_number)'''{"iron_level_tenths_ppm": {"value": 0},"hardness_unit_enum": {"value": 0},"hardness_grains": {"value": 11},"salt_level_tenths": {"value": 20,"percent": 25},"salt_monitor_enum": {"value": 1},"volume_unit_enum": {"value": 0},"regen_enable_enum": {"value": 1},"regen_time_secs": {"value": 7200},"time_format_enum": {"value": 0},"time_zone_enum": {"value": "America/Denver"},"date_format_enum": {"value": 0},"water_shutoff_valve_req": {"value": 0},"total_water_available_gallons": {"value": 2224},"current_water_flow": {"value": 0.0},"gallons_used_today": {"value": 38},"average_daily_use_gallons": {"value": 90},"regen_status_enum": {"value": 0},"out_of_salt_estimated_days": {"value": 130},"days_since_last_regen": {"value": 14},"model_id": {"value": <model id>},"model_description": {"value": "Rheem RHW42"},"system_type": {"value": "demand softener","type": "softener"},"water_shutoff_valve": {"value": 0},"water_shutoff_valve_installed": {"value": 1},"water_shutoff_valve_override": {"value": 0},"water_shutoff_valve_device_action": {"value": 0},"water_shutoff_valve_error_code": {"value": 0},"base_software_version": {"value": "r4.4 MPC01082"},"power": "Online","device_date": "2023-07-29T09:44:38.149000","refresh_policy": {"delay": "low","time": 300000}}'''Contributing and DevelopmentUpdate git-submod-lib submodule for current Makefile Targetsgitsubmoduleupdate--init--remoteMake Python venv and install requirementsmake-fgit-submod-lib/makefile/MakefilevenvMake and commit changes, and then build locally as follows.Build Locallymake-fgit-submod-lib/makefile/Makefilebuild-pythonMake a pull request tomainwith your changesmake-fgit-submod-lib/makefile/Makefilepull-request-mainReleasingMinor releasesmake-fgit-submod-lib/makefile/Makefilepromotion-alphaOnce the PR is approved and merged:make-fgit-submod-lib/makefile/Makefilegithub-releaseOnce the Release is published:make-fgit-submod-lib/makefile/Makefiletwine-uploadNow cut a version release branch:make-fgit-submod-lib/makefile/Makefilegithub-branchNow movemainto the nextalphaversion to capture future developmentmake-fgit-submod-lib/makefile/Makefileversion-alphaPatch releasesStart with the version branch to be patched (ie0.0.x)make-fgit-submod-lib/makefile/Makefilepromotion-patchOnce the PR is approved and merged:make-fgit-submod-lib/makefile/Makefilegithub-release-patchOnce the Patch Release is published:make-fgit-submod-lib/makefile/Makefiletwine-upload