Skip to content

Commit

Permalink
Merge branch 'master' into 103-feat-add-new-device-lambda-sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
jontofront authored Dec 16, 2024
2 parents ab17bdd + 04c6b7d commit bba2cdd
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 14 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ These binary sensors are retrieved from the `../econet/regParams` and `../econet
| `mainSrv` | Indicates if the main server is operational | `../econet/sysParams` |
| `wifi` | Indicates if the Wi-Fi connection is active | `../econet/sysParams` |
| `lan` | Indicates if the LAN connection is active | `../econet/sysParams` |
</details>

### Number Entities

Expand All @@ -185,7 +184,6 @@ These number entities are retrieved from the `../econet/rmCurrentDataParamsEdits
| `tempCOSet` | Desired fireplace set temperature | `../econet/rmCurrentDataParamsEdits` |
| `tempCWUSet` | Desired hot water (CWU) set temperature | `../econet/rmCurrentDataParamsEdits` |

</details>

## Contributing

Expand Down
33 changes: 30 additions & 3 deletions custom_components/econet300/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@
"lambdaLevel",
},
"_default": {
"boilerPower",
"tempFeeder",
"fuelLevel",
"tempCO",
"tempCOSet",
"statusCWU",
"tempCWU",
"tempCWUSet",
"tempFlueGas",
"mode",
Expand All @@ -112,6 +114,12 @@
"quality",
"signal",
"softVer",
"controllerID",
"moduleASoftVer",
"moduleBSoftVer",
"moduleCSoftVer",
"moduleLambdaSoftVer",
"modulePanelSoftVer",
},
}

Expand Down Expand Up @@ -170,6 +178,13 @@
"mode": None,
"thermostat": None,
"statusCWU": None,
"softVer": None,
"controllerID": None,
"moduleASoftVer": None,
"moduleBSoftVer": None,
"moduleCSoftVer": None,
"moduleLambdaSoftVer": None,
"modulePanelSoftVer": None,
}

# By default all sensors device_class are None
Expand All @@ -193,7 +208,6 @@
"tempLowerBuffer": SensorDeviceClass.TEMPERATURE,
"signal": SensorDeviceClass.SIGNAL_STRENGTH,
"servoMixer1": SensorDeviceClass.ENUM,
"main_server": None,
}

ENTITY_NUMBER_SENSOR_DEVICE_CLASS_MAP = {
Expand Down Expand Up @@ -232,6 +246,13 @@
"statusCWU": None,
"thermostat": None,
"mode": None,
"softVer": None,
"controllerID": None,
"moduleASoftVer": None,
"moduleBSoftVer": None,
"moduleCSoftVer": None,
"moduleLambdaSoftVer": None,
"modulePanelSoftVer": None,
}

ENTITY_ICON = {
Expand All @@ -256,7 +277,6 @@
"additionalFeeder": "mdi:screw-lag",
"pumpFireplaceWorks": "mdi:pump",
"pumpCWUWorks": "mdi:pump",
"main_server": "mdi:server",
"mixerPumpWorks": "mdi:pump",
"mixerTemp": "mdi:thermometer",
"mixerSetTemp": "mdi:thermometer",
Expand All @@ -265,6 +285,13 @@
"mixerTemp1": "mdi:thermometer",
"mainSrv": "mdi:server-network",
"lan": "mdi:lan-connect",
"softVer": "mdi:alarm-panel-outline",
"controllerID": "mdi:alarm-panel-outline",
"moduleASoftVer": "mdi:raspberry-pi",
"moduleBSoftVer": "mdi:raspberry-pi",
"moduleCSoftVer": "mdi:raspberry-pi",
"moduleLambdaSoftVer": "mdi:raspberry-pi",
"modulePanelSoftVer": "mdi:alarm-panel-outline",
}

ENTITY_ICON_OFF = {
Expand All @@ -289,7 +316,6 @@
else ("start" if x == 1 else ("working" if x == 2 else STATE_UNKNOWN))
)
),
"main_server": lambda x: "Server available" if x == 1 else "Server not available",
"statusCWU": lambda x: "Not set" if x == NO_CWU_TEMP_SET_STATUS_CODE else "Set",
"thermostat": lambda x: "ON" if x == 1 else "OFF",
}
Expand All @@ -305,6 +331,7 @@
"moduleLambdaSoftVer": EntityCategory.DIAGNOSTIC,
"protocolType": EntityCategory.DIAGNOSTIC,
"controllerID": EntityCategory.DIAGNOSTIC,
"moduleCSoftVer": EntityCategory.DIAGNOSTIC,
"mainSrv": EntityCategory.DIAGNOSTIC,
"wifi": EntityCategory.DIAGNOSTIC,
"lan": EntityCategory.DIAGNOSTIC,
Expand Down
5 changes: 5 additions & 0 deletions custom_components/econet300/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ def create_controller_sensors(
"Created and appended sensor entity from regParams: %s", entity
)
elif data_key in data_sysParams:
if data_sysParams.get(data_key) is None:
_LOGGER.warning(
"%s in sysParams is null, sensor will not be created.", data_key
)
continue
entity = EconetSensor(
create_sensor_entity_description(data_key), coordinator, api
)
Expand Down
21 changes: 18 additions & 3 deletions custom_components/econet300/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,27 @@
"firing_up_count": {
"name": "Firing up count"
},
"main_server": {
"name": "Main server"
},
"soft_ver": {
"name": "Module ecoNET version"
},
"controller_id": {
"name": "Controller name"
},
"module_a_soft_ver": {
"name": "Module A version"
},
"module_b_soft_ver": {
"name": "Module B version"
},
"module_c_soft_ver": {
"name": "Module C version"
},
"module_lambda_soft_ver": {
"name": "Module Lambda version"
},
"module_panel_soft_ver": {
"name": "Module Panel version"
},
"mode": {
"name": "Boiler mode",
"state": {
Expand Down
21 changes: 18 additions & 3 deletions custom_components/econet300/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@
"lambda_level": {
"name": "Lambda level"
},
"main_server": {
"name": "Main server"
},
"work_at100": {
"name": "Work at 100%"
},
Expand Down Expand Up @@ -153,6 +150,24 @@
"soft_ver": {
"name": "Module ecoNET version"
},
"controller_id": {
"name": "Controller name"
},
"module_a_soft_ver": {
"name": "Module A version"
},
"module_b_soft_ver": {
"name": "Module B version"
},
"module_c_soft_ver": {
"name": "Module C version"
},
"module_lambda_soft_ver": {
"name": "Module Lambda version"
},
"module_panel_soft_ver": {
"name": "Module Panel version"
},
"servo_mixer1": {
"name": "Mixer 1 servo position"
},
Expand Down
3 changes: 0 additions & 3 deletions custom_components/econet300/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@
"mixer_set_temp1": {
"name": "Temp. zadana mieszacza 1"
},
"main_server": {
"name": "Główny serwer"
},
"mode": {
"name": "Tryb pracy",
"state": {
Expand Down

0 comments on commit bba2cdd

Please sign in to comment.