Minimizing the energy consumption is one of the main challenges in Internet of Things (IoT) networks. Recently, the IEEE 802.11ah standard has been released as a new low-power Wi-Fi solution for IoT. It has several features, such as Restricted Access Window (RAW) and Target Wake Time (TWT), that promise to improve energy consumption. In this paper, we present an extension of the IEEE 802.11ah module in ns-3 with support for the TWT feature. We study how the energy consumption is affected by the coexistence of RAW and TWT stations (STAs). The results show that the presence of RAW STAs can have an extreme negative effect on the energy efficiency of TWT STAs. Proper scheduling of channel access for both RAW and TWT STAs can mitigate this effect without negatively affecting throughput of RAW STAs.