mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
Non-script HA entities (switch/light/input_boolean) on the printer card always sent turn_on when clicked, which is a no-op when the switch is already on. Now sends toggle for non-script entities so the badge click actually changes the switch state. Script entities still use turn_on. Also fix SmartPlugManager._get_plug_for_printer() using scalar_one_or_none() which crashes with MultipleResultsFound when multiple plugs are assigned to the same printer (e.g., Tasmota + HA switch). Now fetches all plugs and returns the main non-script plug. Add tests for both fixes: _get_plug_for_printer multi-plug handling (5 tests) and canonicalFilamentType/filamentTypesCompatible/autoMatch PA-CF equivalence (8 tests).