@@ -785,21 +785,27 @@ def _get_gateway_measurements(self, entity_id: str, data: GwEntityData) -> None:
785785 ) is None :
786786 continue
787787
788- if measurement == "wind_vector" :
789- value_list : list [str ] = str (value ).split ("," )
790- data ["weather" ]["wind_speed" ] = format_measure (
791- value_list [0 ].strip ("(" ),
792- getattr (attrs , ATTR_UNIT_OF_MEASUREMENT ),
793- )
794- data ["weather" ]["wind_bearing" ] = format_measure (
795- value_list [1 ].strip (")" ),
796- getattr (attrs , ATTR_UNIT_OF_MEASUREMENT ),
797- )
798- self ._count += 2
799- else :
800- key = cast (WeatherType , measurement )
801- data ["weather" ][key ] = value
802- self ._count += 1
788+ match measurement :
789+ case "solar_irradiance" :
790+ # Not available in HA weather platform -> sensor
791+ key = cast (SensorType , measurement )
792+ data ["sensors" ][key ] = value
793+ self ._count += 1
794+ case "wind_vector" :
795+ value_list : list [str ] = str (value ).split ("," )
796+ data ["weather" ]["wind_speed" ] = format_measure (
797+ value_list [0 ].strip ("(" ),
798+ getattr (attrs , ATTR_UNIT_OF_MEASUREMENT ),
799+ )
800+ data ["weather" ]["wind_bearing" ] = format_measure (
801+ value_list [1 ].strip (")" ),
802+ getattr (attrs , ATTR_UNIT_OF_MEASUREMENT ),
803+ )
804+ self ._count += 2
805+ case _:
806+ key = cast (WeatherType , measurement )
807+ data ["weather" ][key ] = value
808+ self ._count += 1
803809
804810 def _loc_value (
805811 self , loc_id : str , measurement : str , attrs : DATA | UOM
0 commit comments