An apparatus and methods for controlling energy consumption of an electronic device determine an availability of an energy source to provide energy to the electronic device. In said method, especially a test pattern is presented which consists of various views A, wherein k=1,. The resource group label attribute is assigned to the resource group object.