original_docstring: Set up a Toon binary sensor based on a config entry.
docstring: Set up a Toon binary sensor based on a config entry.
docstring_tokens: Set up a Toon binary sensor based on a config entry .
code: async def async_setup_entry(
      hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
  ) -> None:
      """Set up a Toon binary sensor based on a config entry."""
      toon = hass.data[DATA_TOON][entry.entry_id]
  
      sensors = [
          ToonBoilerModuleBinarySensor(
              toon,
              "thermostat_info",
              "boiler_connected",
              None,
              "Boiler Module Connection",
              "mdi:check-network-outline",
              "connectivity",
          ),
          ToonDisplayBinarySensor(
              toon,
              "thermostat_info",
              "active_state",
              4,
              "Toon Holiday Mode",
              "mdi:airport",
              None,
          ),
          ToonDisplayBinarySensor(
              toon,
              "thermostat_info",
              "next_program",
              None,
              "Toon Program",
              "mdi:calendar-clock",
              None,
          ),
      ]
  
      if toon.thermostat_info.have_ot_boiler:
          sensors.extend(
              [
                  ToonBoilerBinarySensor(
                      toon,
                      "thermostat_info",
                      "ot_communication_error",
                      "0",
                      "OpenTherm Connection",
                      "mdi:check-network-outline",
                      "connectivity",
                  ),
                  ToonBoilerBinarySensor(
                      toon,
                      "thermostat_info",
                      "error_found",
                      255,
                      "Boiler Status",
                      "mdi:alert",
                      "problem",
                      inverted=True,
                  ),
                  ToonBoilerBinarySensor(
                      toon,
                      "thermostat_info",
                      "burner_info",
                      None,
                      "Boiler Burner",
                      "mdi:fire",
                      None,
                  ),
                  ToonBoilerBinarySensor(
                      toon,
                      "thermostat_info",
                      "burner_info",
                      "2",
                      "Hot Tap Water",
                      "mdi:water-pump",
                      None,
                  ),
                  ToonBoilerBinarySensor(
                      toon,
                      "thermostat_info",
                      "burner_info",
                      "3",
                      "Boiler Preheating",
                      "mdi:fire",
                      None,
                  ),
              ]
          )
  
      async_add_entities(sensors, True)
code_tokens: async def async_setup_entry ( hass : HomeAssistantType , entry : ConfigEntry , async_add_entities ) -> None : toon = hass . data [ DATA_TOON ] [ entry . entry_id ] sensors = [ ToonBoilerModuleBinarySensor ( toon , "thermostat_info" , "boiler_connected" , None , "Boiler Module Connection" , "mdi:check-network-outline" , "connectivity" , ) , ToonDisplayBinarySensor ( toon , "thermostat_info" , "active_state" , 4 , "Toon Holiday Mode" , "mdi:airport" , None , ) , ToonDisplayBinarySensor ( toon , "thermostat_info" , "next_program" , None , "Toon Program" , "mdi:calendar-clock" , None , ) , ] if toon . thermostat_info . have_ot_boiler : sensors . extend ( [ ToonBoilerBinarySensor ( toon , "thermostat_info" , "ot_communication_error" , "0" , "OpenTherm Connection" , "mdi:check-network-outline" , "connectivity" , ) , ToonBoilerBinarySensor ( toon , "thermostat_info" , "error_found" , 255 , "Boiler Status" , "mdi:alert" , "problem" , inverted = True , ) , ToonBoilerBinarySensor ( toon , "thermostat_info" , "burner_info" , None , "Boiler Burner" , "mdi:fire" , None , ) , ToonBoilerBinarySensor ( toon , "thermostat_info" , "burner_info" , "2" , "Hot Tap Water" , "mdi:water-pump" , None , ) , ToonBoilerBinarySensor ( toon , "thermostat_info" , "burner_info" , "3" , "Boiler Preheating" , "mdi:fire" , None , ) , ] ) async_add_entities ( sensors , True )
short_docstring: Set up a Toon binary sensor based on a config entry.
short_docstring_tokens: Set up a Toon binary sensor based on a config entry .
comment: """Set up a Toon binary sensor based on a config entry."""