import { PropertyValues } from "lit" ; import { HomeAssistant } from "./types" ; export function hasConfigOrEntityChanged ( element , changedProps , forceUpdate ) { if ( changedProps . has ( 'config' ) || forceUpdate ) { return true ; } if ( element . config ! . entity ) { const oldHass = changedProps . get ( 'hass' ) as HomeAssistant | undefined ; if ( oldHass ) { return ( oldHass . states [ element . config ! . entity ] !== element . hass ! . states [ element . config ! . entity ] ) ; } return true ; } else { return false ; } }