File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,6 @@ export const extractAttributes = (
59
59
if ( item . attributes . hasOwnProperty ( c . value ) ) {
60
60
const attributeValue = item . attributes [ c . value ] ;
61
61
if ( attributeValue === null ) {
62
- const attributeName = hass . formatEntityAttributeName ? hass . formatEntityAttributeName ( item , c . value ) : c . value ;
63
- p . push ( {
64
- name : c . label ? c . label : attributeName ,
65
- value : 'null' ,
66
- } ) ;
67
62
return p ;
68
63
}
69
64
if ( typeof attributeValue === 'object' && ! Array . isArray ( attributeValue ) ) {
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ describe('attributes', () => {
270
270
} ) ;
271
271
} ) ;
272
272
273
- test ( 'attributes with null' , ( ) => {
273
+ test ( 'attributes with null should be ignored ' , ( ) => {
274
274
const raw = [
275
275
{
276
276
entity_id : 'sensor.notify_last_redmi_all_attr' ,
@@ -299,11 +299,8 @@ describe('attributes', () => {
299
299
300
300
const history = toHistory ( raw , hass , configuration ) ;
301
301
history . forEach ( h => {
302
- expect ( h . attributes . length ) . toBe ( 2 ) ;
303
- expect ( h . attributes ) . toEqual ( [
304
- { name : 'Apps' , value : 'null' } ,
305
- { name : 'icon' , value : 'mdi:message' } ,
306
- ] ) ;
302
+ expect ( h . attributes . length ) . toBe ( 1 ) ;
303
+ expect ( h . attributes ) . toEqual ( [ { name : 'icon' , value : 'mdi:message' } ] ) ;
307
304
} ) ;
308
305
} ) ;
309
306
You can’t perform that action at this time.
0 commit comments