spacemanspiff2007 / HABApp

Easy home automation with MQTT and/or openHAB
Apache License 2.0
54 stars 23 forks source link

Documentation of EventListenerGroup #406

Closed UrsusS closed 9 months ago

UrsusS commented 11 months ago

The adaptation of the example in https://habapp.readthedocs.io/en/latest/util.html#eventlistenergroup leads to an error from mypy:

        self.OutdoorSensorListeners = EventListenerGroup().add_listener(
            [self.Outside_TempItem, self.Outside_HumidItem],
            self.Outside_Humidity,
            ValueChangeEvent,
        )

Value of type variable "HINT_EVENT_FILTER_OBJ" of "add_listener" of "EventListenerGroup" cannot be "Type[ValueChangeEvent]" [type-var]

Most probably the ValueChangeEvent should be ValueChangeEventFilter().

        self.OutdoorSensorListeners = EventListenerGroup().add_listener(
            [self.Outside_TempItem, self.Outside_HumidItem],
            self.Outside_Humidity,
            ValueChangeEventFilter(),
        )
spacemanspiff2007 commented 11 months ago

Thanks for the report - I'll look into it.

spacemanspiff2007 commented 9 months ago

Fixed in DEV, thank you for the hint.