Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ shelly:
| name | Specify if you want to set a name of the device | My Cool Shelly | |
| entity_id | Override the auto generated part of entity_id, like shsw_1_500500 | bedlamp | 0.0.16- |
| light_switch | Show this switch as a light | True | |
| dimmable | Show this dimmer as a dimmable light (set to false for non-dimmable bulbs) | True | |
| sensors | A list with sensors to show for each device. This will override the global sensors. See list below. | | 0.0.15- |
| upgrade_switch | Add firmware switches when upgrade needed. Override global configuration. | False | 0.0.15- |
| unavailable_after_sec | Overide number of seconds before the device will be unavialable. | 120 | 0.0.16- |
Expand Down
2 changes: 2 additions & 0 deletions custom_components/shelly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ async def _async_device_added(self, dev, _code):
elif dev.device_type == "BINARY_SENSOR":
self.add_device("binary_sensor", dev)
elif dev.device_type in ["LIGHT", "DIMMER", "RGBLIGHT"]:
if device_config.get(CONF_DIMMER_DIMMABLE) == False:
dev.device_type = "RELAY"
self.add_device("light", dev)
else:
_LOGGER.error("Unknown device type, %s", dev.device_type)
Expand Down
1 change: 1 addition & 0 deletions custom_components/shelly/configuration_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
vol.Required(CONF_ID): cv.string,
vol.Optional(CONF_NAME): cv.string,
vol.Optional(CONF_LIGHT_SWITCH, default=False): cv.boolean,
vol.Optional(CONF_DIMMER_DIMMABLE, default=True): cv.boolean,
vol.Optional(CONF_SENSORS):
vol.All(cv.ensure_list, [vol.In(ALL_SENSORS_W_EXTRA)]),
vol.Optional(CONF_UPGRADE_SWITCH): cv.boolean,
Expand Down
1 change: 1 addition & 0 deletions custom_components/shelly/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
CONF_IGMPFIX = 'igmp_fix'
CONF_MDNS = 'mdns'
CONF_LIGHT_SWITCH = 'light_switch'
CONF_DIMMER_DIMMABLE = 'dimmable'
CONF_OBJECT_ID_PREFIX = 'id_prefix'
CONF_ENTITY_ID = 'entity_id'
CONF_SHOW_ID_IN_NAME = 'show_id_in_name'
Expand Down