danimtb / sonoff-danimtb

Alternative firmware for Itead Sonoff (ESP8266/ESP8285 based) devices to use them in Home Assistant
12 stars 3 forks source link

Improvements for double relay #28

Closed lasote closed 6 years ago

lasote commented 6 years ago
danimtb commented 6 years ago

Looks good and new entry in ini file is totally fine.

I'll also keep the script to compress the html.

However, I dont think another discovery prefix is needed. That prefix should be a general parameter for the MQTTManager object. Fo the second relay you only need to add that MqttDiscoveryConponent for that relay as a light/switch.

I'll take a better look to it later.

Thanks!

danimtb commented 6 years ago

otherwise the discovery made no sense and was not working

I would like to hear more about this: Why is it not working with two components for same discovery prefix?

The only thing I see that makes sense is to have two device names, one for each light.

lasote commented 6 years ago

Well, the component can be light and switch. If, for the same device you have two lights, who's distinguishing them in the discovery if they belong to the same device?

lasote commented 6 years ago

I added two improvements:

  1. Web interface now shows a message when submit (device is going to reset...)
  2. Relay2 long press associated to secondary for relay2