import { HassEntity } from "home-assistant-js-websocket" ; import { supportsFeature } from "./SupportsFeature" ; export default function featureClassNames ( entity , classNames ) { if ( ! entity || ! entity . attributes . supported_features ) { return [ ] ; } return Object . keys ( classNames ) . map ( ( feature ) => supportsFeature ( entity , Number ( feature ) ) ? classNames [ Number ( feature ) ] : "" ) . filter ( ( attr ) => attr !== "" ) ; }