Closed avocadio closed 4 years ago
Thanks! Opened a fix in #62!
Thanks! I know have an expected warning: Sensor not implemented for value <custom_components.zwave_mqtt.entity.ZWaveDeviceEntityValues object at 0xae7d62b0>
oh, that log statement was pretty useless 🤔 Updated the PR.
This was still referring to memory addresses so decided to get my hands dirty :)
This is a modest 1st PR
The output is as follow:
Sensor not implemented for value <custom_components.zwave_mqtt.entity.ZWaveDeviceEntityValues object at 0xae6b7dd0>: {'_hass': <homeassistant.core.HomeAssistant object at 0xb515cff0>, '_schema': {'component': 'sensor', 'values': {'power': {'schemas': [{'command_class': [49], 'index': [4]}, {'command_class': [50], 'index': [2]}], 'optional': True, 'instance': [1]}, 'primary': {'command_class': [49, 50, 113, 156, 135, 128], 'genre': 'User', 'instance': [1]}}, 'node_id': [22]}, '_values': {'power': None, 'primary': <openzwavemqtt.models.value.OZWValue object at 0xae6b7ef0>}, '_entity': None, '_entity_created': True, '_options': <openzwavemqtt.options.OZWOptions object at 0xb14805d0>, '_node': <openzwavemqtt.models.node.OZWNode object at 0xae68f470>}
Instead of dumping all the instance variables of an object, let's add __repr__
functions to all the models in https://github.com/cgarwood/python-openzwave-mqtt
Formatted output
{'_entity': None,
'_entity_created': True,
'_schema': {'component': 'sensor',
'node_id': [22],
'values': {'power': {'instance': [1],
'optional': True,
'schemas': [{'command_class': [49],
'index': [4]},
{'command_class': [50],
'index': [2]}]},
'primary': {'command_class': [49,
50,
113,
156,
135,
128],
'genre': 'User',
'instance': [1]}}},
'_values': {'power': None}}
I'm testing MQTT Zwave, and reporting my first bug :)
https://github.com/cgarwood/homeassistant-zwave_mqtt/blob/08fc96f3ab7fff37f77057f7a8da8d4c8c9e448c/custom_components/zwave_mqtt/sensor.py#L33
Exception in async_add_sensor when dispatching 'zwave_new_sensor': (<custom_components.zwave_mqtt.entity.ZWaveDeviceEntityValues object at 0xae7575d0>,)
Traceback (most recent call last):
File "/config/custom_components/zwave_mqtt/sensor.py", line 33, in async_add_sensor async_add_entities([sensor])
UnboundLocalError: local variable 'sensor' referenced before assignment