MCPcopy Create free account
hub / github.com/Bbalduzz/fletmint / toggle_switch

Method toggle_switch

fletmint/toggle_switch.py:97–104  ·  view source on GitHub ↗

Toggle between the two states.

(self, e)

Source from the content-addressed store, hash-verified

95 )
96
97 def toggle_switch(self, e):
98 """Toggle between the two states."""
99 self.value = 0 if self.value == 1 else 1
100 self.content.controls[0] = self.get_container(self.moon_icon, self.value == 0)
101 self.content.controls[1] = self.get_container(self.sun_icon, self.value == 1)
102 self.update()
103 if self.on_switch:
104 self.on_switch(self.value)
105
106 def get_value(self):
107 """Return the current toggle state."""

Callers

nothing calls this directly

Calls 1

get_containerMethod · 0.95

Tested by

no test coverage detected